#ifndef _DNSIMPL_H_
#define _DNSIMPL_H_

#include "stdafx.h"

class CDnsImpl : public IDns, public IOperationProc, public CUnknownImp
{
public:
    CDnsImpl();
    virtual ~CDnsImpl(void);

public:
    BEGIN_STDCOM_MAP
    STDCOM_INTERFACE_ENTRY_UNKNOWN_(IDns);
    STDCOM_INTERFACE_ENTRY(IDns);
    STDCOM_INTERFACE_ENTRY(IOperationProc);
    END_STDCOM_MAP

    HRESULT init_class(const _lComPtr<IAsynFrame>& AsynFrame);

    // IDns
    std_method(Post)(LPCSTR hostname, IBase* pProc);
    std_method(Close)();

    // IIoOperationEvents
    std_method(OnComplete)(IBase* pOperation, crtid cid, crterr err);

private:
    _lComPtr<IUdpSocket> m_pISocket;
    _lComPtr<IOperation> m_pIOperation;
    CSemHandle m_sem;
};

#endif
